// 商品属性相关操作
import request,{Method} from '@/libs/api.js'

// 获取售后数据的分页信息
export function getAfterSalePage (params) {
    return request({
      url: '/order/aftersale/getAfterSalePage',
      method: Method.POST,
      data: params
    });
}

// 根据售后的sn号码获取售后的详情信息
export function getAfterSaleDetail (sn) {
  return request({
    url: `/order/aftersale/getAfterSaleDetail/${sn}`,
    method: Method.GET,
  });
}

// 获取商家售后收件地址
export function getStoreAfterSaleAddress (sn) {
  return request({
    url: `/order/aftersale/getStoreAfterSaleAddress/${sn}`,
    method: Method.GET,
  });
}

// 审核售后申请
export function review (params) {
    return request({
      url: '/order/aftersale/review',
      method: Method.POST,
      data: params
    });
}

// 审核售后申请
export function confirm (params) {
    return request({
      url: '/order/aftersale/confirm',
      method: Method.POST,
      data: params
    });
}

// 获取售后物流信息
export function getAfterSaleDeliveryTraces (sn) {
  return request({
    url: `/order/aftersale/getAfterSaleDeliveryTraces/${sn}`,
    method: Method.GET,
  });
}

export function getOrderComplaintByPage (params) {
  return request({
    url: '/order/ordercomplaint/getOrderComplaintByPage',
    method: Method.POST,
    data: params
  });
}

// 获取投诉详情
export function getOrderComplaintDetail (id) {
  return request({
    url: `/order/ordercomplaint/getOrderComplaintDetail/${id}`,
    method: Method.GET,
  });
}

// 投诉过程中三个角色进行交流
export function communication (params) {
  return request({
    url: '/order/ordercomplaintcommunication/communication',
    method: Method.POST,
    data: params
  });
}

// 商家申诉
export function appeal (params) {
  return request({
    url: '/order/ordercomplaint/appeal',
    method: Method.PUT,
    data: params
  });
}
